dxp-ux

(0 reviews)

POST Prepay-Topup Balance (TMF-654)

[POST]

The createTopupBalance API provides 2 below features,

#createTopupBalance#: allows the customer to top up their account with a mobile number that they have specified (MSISDN) or subscriptionId.

#Retrive Tax Info#: API returns the estimated tax amount before making the top-up if we call API with field reason = TAX.

Please find sample requests and responses for both scenarios below.

This API is available for LCPR.

URL

http://[localhost]:[port]/dxp-ux/v1/{businessId}/topupBalance

URL PARAMS

nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country code (TT, BB, JM, PA, PR etc.) identifying the business unit.Y
namevaluedescriptionrequired
client_idstringThe client_id identifying the channel. Minimum characters: 5Y
client_secretstringPassword associated with the client_id. Minimum characters: 5Y
lobstringThe Line of Business Identifier currently available are:
FIXED
PREPAID
POSTPAID
N
channeIdstringChannel to business:
Allowed value: "APP"
Y
X-Correlation-IDstringIdentifier that correlates HTTP request between a client and server.
Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction.
Y
targetSystemStringThis describes the target system. โ€œMatrixxโ€ is in scope.Y

REQUEST BODY FOR TAX_INFORMATION

Note - 1) The possiable values of reason attributes are "TAX/ESTIMATE/TAX ESTIMATE"

2) No need to pass valid voucher(one time code/nonce) code, it will accept any dumy value.

REQUEST BODY FOR TAX_INFORMATION using MSISDN


{
    "amount": {
        "amount": 100,
        "units": "USD"
    },
    "reason": "TAX ESTIMATE",
    "voucher": "A",
    "product": [
        {
            "id": "01",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "partyAccount": {
        "id": "9347455272",
        "@type": "MSISDN"
    }
}
Definitions
Each of the request parameters is detailed for Tax information request body
Field NameM/ODescriptionDataType
amountMobjectQuantity
amount.amountMUnit number, the amount that you are doing recharge to customernumber
amount.unitsOCurrency (ISO4217 norm uses 3 letters to define the currency)string
ReasonMThe "reason" field it should be passed as (tax, estimate, tax estimate) and the voucher field is passed as null or random values, to obtain tax details before paying for the topupstring
voucherMVoucher is mandatory field we should have to any random value or null , to obtain tax details before paying for the topup,string
productMA reference to the Product associated with this bucketarray
product.idMno significance required field in raml , but we are not passing any value we are passing as empty stringstring
product.nameMName of the related entity,it is a product name recharge offer name ,it is hardcoded valuestring
product.@typeMit is a offer type , it is hardcoded valuestring
partyAccountMobjectstring
partyAccount.idMCustomer Mobile Numberstring
partyAccount.typeMHard coded value "MSISDN"string

RESPONSE BODY FOR TAX_INFORMATION

{
    "status": "Success",
    "amount": {
        "amount": 100,
        "units": "USD"
    },
    "voucher": "A",
    "reason": "TAX ESTIMATE",
    "product": [
        {
            "id": "0",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "validFor": {
        "endDateTime": "65535-12-31T23:59:59.999999Z",
        "startDateTime": "2022-08-30T09:07:14.000Z"
    },
    "bucket": {
        "id": "1",
        "name": "Prepaid Balance"
    },
    "impactedBucket": [
        {
            "amountAfter": 111.5,
            "name": "Total Amount",
            "item": [
                {
                    "amount": 10.5,
                    "name": "STATE SALES TAX"
                },
                {
                    "amount": 1.0,
                    "name": "CITY SALES TAX"
                }
            ]
        }
    ],
    "partyAccount": {
        "id": "9347455272",
        "@type": "MSISDN"
    }
}
Definitions
Each of the response parameters is detailed for Tax information response body
Field NameDataTypeDescriptionM/O
statusstringValid values for the Action Status TypeN
amountQuantityobjectN
amount.amountnumberUnit number, the amount that you are doing recharge to customerN
amount.unitsstringCurrency (ISO4217 norm uses 3 letters to define the currency)N
ReasonThe "reason" field it should have to passed as (tax, estimate, tax estimate) and the voucher field is passed as null or random values, to obtain tax details before paying for the topupN
voucherstringVoucher is mandatory field we should have to any random value or null , to obtain tax details before paying for the topup,N
validForobjectA period of time, either as a deadline (endDateTime only) a startDateTime only, or bothN
validFor.startDateTimedatetimeStart of the time period, using IETC-RFC-3339 format. If you define a start, you must also define an endN
validFor.endDateTimedatetimeEnd of the time period, using IETC-RFC-3339 formatN
bucketobjectlink to the resource that holds bucket informationN
bucket.idstringunique identifierN
bucket.namestringName of the related entity.N
impactedBucketarrayTax informationN
amountAfterstringThe total amount that you are paying for topup with Tax includesN
impactedBucket.namestringName of the impactedBucket.N
impactedBucket.itemarrayArray of items in impactedBucket.N
impactedBucket.item.amountintegerAmount paying for STATE SALES TAX and CITY SALES TAXN
impactedBucket.item.namestringName related to STATE SALES TAX and CITY SALES TAXN
productarrayA reference to the Product associated with this bucketN
product.idstringno significance required field in raml , but we are not passing any value we are passing as empty stringN
product.namestringName of the related entity,it is a product name recharge offer name ,it is hardcoded valueN
product.@typestringit is a offer type , it is hardcoded valueN
partyAccountstringobjectN
partyAccount.idstringCustomer Mobile NumberN
partyAccount.typestringHard coded value "MSISDN"N

REQUEST BODY FOR TAX_INFORMATION using subscriptionId


{
    "amount": {
        "amount": 100,
        "units": "USD"
    },
    "reason": "TAX ESTIMATE",
    "voucher": "A",
    "product": [
        {
            "id": "01",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "partyAccount": {
        "id": "S-94537890",
        "@type": "subscriptionId"
    }
}
Definitions
Each of the request parameters is detailed for Tax information request body
Field NameM/ODescriptionDataType
amountMobjectQuantity
amount.amountMUnit number, the amount that you are doing recharge to customernumber
amount.unitsOCurrency (ISO4217 norm uses 3 letters to define the currency)string
ReasonMThe "reason" field it should have to passed as (tax, estimate, tax estimate) and the voucher field is passed as null or random values, to obtain tax details before paying for the topup,string
voucherMVoucher is mandatory field we should have to any random value or null , to obtain tax details before paying for the topup,string
productMA reference to the Product associated with this bucketarray
product.idMno significance required field in raml , but we are not passing any value we are passing as empty stringstring
product.nameMName of the related entity,it is a product name recharge offer name ,it is hardcoded valuestring
product.@typeMit is a offer type , it is hardcoded valuestring
partyAccountMobjectstring
partyAccount.idMCustomer subscriptionIdstring
partyAccount.typeMHard coded value "subscriptionId"string

RESPONSE BODY FOR TAX_INFORMATION

{
    "status": "Success",
    "amount": {
        "amount": 100,
        "units": "USD"
    },
    "voucher": "A",
    "reason": "TAX ESTIMATE",
    "product": [
        {
            "id": "0",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "validFor": {
        "endDateTime": "65535-12-31T23:59:59.999999Z",
        "startDateTime": "2022-08-30T09:07:14.000Z"
    },
    "bucket": {
        "id": "1",
        "name": "Prepaid Balance"
    },
    "impactedBucket": [
        {
            "amountAfter": 111.5,
            "name": "Total Amount",
            "item": [
                {
                    "amount": 10.5,
                    "name": "STATE SALES TAX"
                },
                {
                    "amount": 1.0,
                    "name": "CITY SALES TAX"
                }
            ]
        }
    ],
    "partyAccount": {
        "id": "S-94537890",
        "@type": "subscriptionId"
    }
}
Definitions
Each of the response parameters is detailed for Tax information response body
Field NameDataTypeDescriptionM/O
statusstringValid values for the Action Status TypeN
amountQuantityobjectN
amount.amountnumberUnit number, the amount that you are doing recharge to customerN
amount.unitsstringCurrency (ISO4217 norm uses 3 letters to define the currency)N
ReasonThe "reason" field it should have to passed as (tax, estimate, tax estimate) and the voucher field is passed as null or random values, to obtain tax details before paying for the topup,N
voucherstringVoucher is mandatory field we should have to any random value or null , to obtain tax details before paying for the topup,N
validForobjectA period of time, either as a deadline (endDateTime only) a startDateTime only, or bothN
validFor.startDateTimedatetimeStart of the time period, using IETC-RFC-3339 format. If you define a start, you must also define an endN
validFor.endDateTimedatetimeEnd of the time period, using IETC-RFC-3339 formatN
bucketobjectlink to the resource that holds bucket informationN
bucket.idstringunique identifierN
bucket.namestringName of the related entity.N
impactedBucketarrayTax informationN
amountAfterstringThe total amount that you are paying for topup with Tax includesN
impactedBucket.namestringName of the impactedBucket.N
impactedBucket.itemarrayArray of items in impactedBucket.N
impactedBucket.item.amountintegerAmount paying for STATE SALES TAX and CITY SALES TAXN
impactedBucket.item.namestringName related to STATE SALES TAX and CITY SALES TAXN
productarrayA reference to the Product associated with this bucketN
product.idstringno significance required field in raml , but we are not passing any value we are passing as empty stringN
product.namestringName of the related entity,it is a product name recharge offer name ,it is hardcoded valueN
product.@typestringit is a offer type , it is hardcoded valueN
partyAccountstringobjectN
partyAccount.idstringCustomer subscriptionIdN
partyAccount.typestringHard coded value "subscriptionId"N

REQUEST BODY FOR TOPUP BALANCE

Note - 1) No need to pass reason attribute.

2) Expecting valid voucher (one time code/nonce) code for complete top-up balance.

{
    "id": "123456",
    "amount": {
        "amount": 100,
        "units": "USD"
    },
    "voucher": "fake-valid-nonce",
    "product": [
        {
            "id": "01",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "relatedParty": [
        {
            "id": "628935575",
            "@type": "PaymentGatewayUserId"
        },
        {
            "id": "0",
            "@type": "PaymentGatewayId"
        }
    ],
    "partyAccount": {
        "id": "9347455272",
        "@type": "MSISDN"
    }
}
Definitions

Each of the request parameters is detailed.

nametypedescriptionrequired
idstringThe unique order id used in the authorize or settlement request. This can be used to track the transaction and aids duplicate checking.N
amountQuantityAn amount in a given unitY
amount.amountstringTop-Up AmountY
amount.unitsstringUnitN
productarrayA reference to the Product associated with this bucket, Consumer should pass as static values like in sample request payload.
Note: As pr TMF-654 guidelines, There should be at least one product of '@type'=offer,
N
product.idstringunique identifierN
product.namestringName of the related entity.N
product.@typestringWhen sub-classing, this defines the sub-class Extensible nameN
partyAccountobjectPartyAccount reference. A party account is an arrangement that a party has with an enterprise thatY
partyAccount.idstringEither subscriber by ExternalID or associated device access numberY
partyAccount.@typestringWhen sub-classing, this defines the sub-class entity name of partyAccount,
In this case either MSISDN/SubscriptionId
N
voucherNonce to use for authorization.
Note - Either "PaymentMethodResourceId" or "voucher" only allow. Both should not allow
After successful Payment, "BRAIN TREE" will send encrypted transaction code/one time code to DXP
Y*
relatedPartyarrayUsed to provide information about any other entity with relation to the operation,
Please refer below relatedParty Table for more details
Y
relatedParty.idUnique identifier of a related entity.Y
relatedParty values
relatedParty typetypedescriptionrequired
PaymentGatewayUserIdstringIdentifier for the customer id on the payment gateway, "BRAIN TREE".Y
PaymentGatewayIdstringIdentifier for the specific payment gateway. If not supplied, the default payment gateway will be used.",Y

RESPONSE BODY FOR TOPUP BALANCE

{
    "id": "123456",
    "confirmationDate": "2022-11-08T08:24:35.000Z",
    "status": "Approved",
    "amount": {
        "amount": 100,
        "units": "USD"
    },
    "voucher": "fake-valid-nonce",
    "product": [
        {
            "id": "0",
            "name": "RechargeOffer",
            "@type": "Offer"
        }
    ],
    "validFor": {
        "endDateTime": "65535-12-31T23:59:59.999999Z",
        "startDateTime": "2022-08-30T09:07:14.000Z"
    },
    "relatedParty": [
        {
            "id": "628935575",
            "@type": "PaymentGatewayUserId"
        },
        {
            "id": "0",
            "@type": "PaymentGatewayId"
        },
        {
            "id": "70",
            "@type": "PaymentResourceIdRef"
        }
    ],
    "bucket": {
        "id": "1",
        "name": "Prepaid Balance"
    },
    "impactedBucket": [
        {
            "amountAfter": 111.5,
            "name": "Total Amount",
            "item": [
                {
                    "amount": 10.5,
                    "name": "STATE SALES TAX"
                },
                {
                    "amount": 1.0,
                    "name": "CITY SALES TAX"
                }
            ]
        }
    ],
    "partyAccount": {
        "id": "9347455272",
        "@type": "MSISDN"
    }
}
Definitions
Each of the response parameters is detailed for Topup Balance response body
Field NameDataTypeDescriptionM/O
idstringThe unique id used in the authorise or settlement request. This can be used to track the transaction and aids duplicate checkingN
statusstringValid values for the Action Status TypeN
confirmationDatedatetimewhen the deduction was confirmed in the serverN
amountQuantityobjectN
amount.amountnumberUnit number, the amount that you are doing recharge to customerN
amount.unitsstringCurrency (ISO4217 norm uses 3 letters to define the currency)N
voucherstringAfter successful Payment, "BRAIN TREE" will send encrypted transaction code/one time codeN
validForobjectA period of time, either as a deadline (endDateTime only) a startDateTime only, or bothN
validFor.startDateTimedatetimeStart of the time period, using IETC-RFC-3339 format. If you define a start, you must also define an endN
validFor.endDateTimedatetimeEnd of the time period, using IETC-RFC-3339 formatN
bucketobjectlink to the resource that holds bucket informationN
bucket.idstringunique identifierN
bucket.namestringName of the related entity. Identify the account type example :PrepaidN
impactedBucketarrayTax informationN
amountAfterstringThe total amount that you are paying for topup with Tax includesN
impactedBucket.namestringName of the impactedBucket.N
impactedBucket.itemarrayArray of items in impactedBucket.N
impactedBucket.item.amountintegerAmount paying for STATE SALES TAX and CITY SALES TAXN
impactedBucket.item.namestringName related to STATE SALES TAX and CITY SALES TAXN
productarrayA reference to the Product associated with this bucketN
product.idstringno significance required field in raml , but we are not passing any value we are passing as empty stringN
product.namestringName of the related entity,it is a product name recharge offer name ,it is hardcoded valueN
product.@typestringIt represents is a offer type , it is hardcoded valueN
partyAccountstringobjectN
partyAccount.idstringCustomer Mobile NumberN
partyAccount.typestringHard coded value "MSISDN"N
relatedParty
nametypedescriptionrequired
PaymentGatewayUserIdstringPayment gate way user id; will get this info from "BRAIN TREE".N
PaymentGatewayIdstringIdentifier for the specific payment gateway. If not supplied, the default payment gateway will be used here default gateway is "BRAIN TREE".N
PaymentResourceIdRefstringPayment resource idN

Possible Error Scenarios: :

IF WE ARE PASSING INVALID (MSISDN) NUMBER IN REQUEST BODY
{
    "errors": [
        {
            "code": 400,
            "message": "MATRIXX:POST_TOPUP_BALANCE",
            "description": "11 | Subscriber not found (AccessNumber=709565949)"
        }
    ]
}
IF WE ARE PASSING INVALID VOUCHER IN REQUEST BODY
{
    "errors": [
        {
            "code": 400,
            "message": "MATRIXX:POST_TOPUP_BALANCE",
            "description": "52 | The AUTHORIZATION_AND_SETTLEMENT Request to Braintree has Failed: Invalid Payment Method Nonce QWEDRFRG"
        }
    ]
}
IF WE ARE PASSING INVALID PAYMENT Gateway ID REQUEST BODY
{
    "errors": [
        {
            "code": 400,
            "message": "MATRIXX:POST_TOPUP_BALANCE",
            "description": "52 | No Payment Gateway with Id 3 has been configured"
        }
    ]
}

Reviews